package com.aiwhose.aiwhosecore.bean.wechatgroup;

import com.aiwhose.aiwhosecore.bean.BaseEntity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.mybatisflex.core.keygen.KeyGenerators;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import java.io.Serial;

/**
 * 存储群二维码信息，包括图片、过期时间、扫描次数等 实体类。
 *
 * @author 田国刚
 * @since 1.0.1
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(description = "存储群二维码信息，包括图片、过期时间、扫描次数等")
@Table(value = "wx_group_qr")
public class WxGroupQr extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键，二维码标识
     */
    @Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
    @Schema(description = "主键，二维码标识")
    private String id;

    /**
     * 群类型标识，外键 (wx_group_types.type_id)
     */
    @Schema(description = "群类型标识，外键 (wx_group_types.type_id)")
    private String typeId;

    /**
     * 二维码图片的URL或二进制数据
     */
    @Schema(description = "二维码图片的URL或二进制数据")
    private String qrCodeImage;

    /**
     * 二维码名称
     */
    @Schema(description = "二维码名称")
    private String qcName;

    /**
     * 排序(1-200)
     */
    @Schema(description = "排序(1-200)")
    private Integer orderBy;

    /**
     * 二维码的过期时间
     */
    @Schema(description = "二维码的过期时间")
    private LocalDateTime expirationDate;

    /**
     * 已扫描次数
     */
    @Schema(description = "已扫描次数")
    private Integer scansCount;

    /**
     * 最大扫描次数（默认200）
     */
    @Schema(description = "最大扫描次数（默认200）")
    private Integer maxScans;

    /**
     * 是否可用（未过期且未达到扫描上限）
     */
    @Schema(description = "是否可用（未过期且未达到扫描上限）")
    private Boolean isActive;


}
